import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { NgModule, ErrorHandler } from '@angular/core';
import { NgZorroAntdModule } from 'ng-zorro-antd';
import { HttpModule } from '@angular/http';
import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';

import { AppComponent } from './app.component';
import { AppRouterModule } from './app.router.module';
//http
import { HttpService } from '../HTTP/http.service';
import { RequestInterceptor } from '../HTTP/http.interceptor';
//apirequest
import { AuthorizeApirequest } from '../ApiRequest/Authorize.Apirequest';
import { AccountApirequest } from '../ApiRequest/Account.Apirequest';
import { UserManageApirequest } from '../ApiRequest/UserManage.Apirequest';
import { AppManageApirequest } from '../ApiRequest/AppManage.Apirequest';
import { AuthorizedAppApirequest } from '../ApiRequest/AuthorizedApp.Apirequest';
import { ConfigmanageApirequest } from '../ApiRequest/ConfigManage.Apirequest';
// errorhandle
// import { SELF_ERRORHANDLER } from '../ErrorHandler/errorhandler.service';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    AppRouterModule,
    NgZorroAntdModule.forRoot(),
    BrowserAnimationsModule,
    HttpModule,
    HttpClientModule,
  ],
  providers: [
    HttpService,
    {
      provide: HTTP_INTERCEPTORS,
      useClass: RequestInterceptor,
      multi: true
    },
    AuthorizeApirequest,
    AccountApirequest,
    UserManageApirequest,
    AppManageApirequest,
    AuthorizedAppApirequest,
    ConfigmanageApirequest,
    // {
    //   provide: ErrorHandler,
    //   useClass: SELF_ERRORHANDLER
    // }
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }
